<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-on补充</title>
</head>
<body>
<div id="app">
    <input type="button" value="点击" @click="doIt(666,'老铁')">
    <!--回车事件触发-->
    <input type="text" @keyup.enter="sayHi">
</div>

<!-- 生产环境版本，优化了尺寸和速度 -->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script type="text/javascript">
    var vue = new Vue({
        el: "#app",
        data: {},
        methods: {
            doIt: function (p1,p2) {
                console.log("做it");
                console.log(p1);
                console.log(p2);
            },
            sayHi:function () {
                alert("hi vue!");
            }
        }
    })
</script>
</body>
</html>
